package ink.lovejinhu.leetcode;

import java.util.Arrays;

/**
 * @author jinhu
 * created 2021-07-29 9:54
 */
public class Solution_0628 {
    public int maximumProduct(int[] nums) {
        Arrays.sort(nums);
        int v0 = nums[0] * nums[1] * nums[2];
        int v1 = nums[nums.length - 1] * nums[nums.length - 2] * nums[nums.length - 3];
        int v2 = nums[nums.length - 1] * nums[0] * nums[1];
        return Math.max(v0, Math.max(v1, v2));

    }
}
